﻿using System;

namespace FrameWork.Core.Ioc
{
    /// <summary>
    /// The registering container
    /// </summary>
    public interface IContainerRegistry
    {
        IContainerRegistry RegisterInstance(Type type, object instance);
   
        IContainerRegistry RegisterInstance(Type type, object instance, string name);

        IContainerRegistry RegisterSingleton(Type from, Type to);

        IContainerRegistry RegisterSingleton(Type from, Type to, string name);

        IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod);

        IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod);

        IContainerRegistry RegisterManySingleton(Type type, params Type[] serviceTypes);

        IContainerRegistry Register(Type from, Type to);

        IContainerRegistry Register(Type from, Type to, string name);

        IContainerRegistry Register(Type type, Func<object> factoryMethod);

        IContainerRegistry Register(Type type, Func<IContainerProvider, object> factoryMethod);

        IContainerRegistry RegisterMany(Type type, params Type[] serviceTypes);

        IContainerRegistry RegisterScoped(Type from, Type to);

        IContainerRegistry RegisterScoped(Type type, Func<object> factoryMethod);

        IContainerRegistry RegisterScoped(Type type, Func<IContainerProvider, object> factoryMethod);

        bool IsRegistered(Type type);

        bool IsRegistered(Type type, string name);
    }
}
